#[allow(unused)]
pub mod types;
#[allow(unused)]
pub mod methods;
#[allow(unused)]
pub mod bodys;
#[allow(unused)]
pub mod vectory;
#[allow(unused)]
pub mod enums;
#[allow(unused)]
pub struct User;
#[allow(unused)]
pub struct People;
#[allow(unused)]
pub struct Queue;


#[allow(unused)]
pub mod vera {
    pub fn let_ver() {
        //只能定义和赋值一次
        let num = 5;
        println!("请输入的数字 {}", num);

        //num = 6; 这种操作是错误的
        println!("请输入的数字 {}", num);

        let num = 6;
        println!("请输入的数字 {}", num);
    }

    pub fn mut_ver() {
        let mut num = 5;
        println!("请输入的数字 {}", num);
        num = 6;
        println!("请输入的数字 {}", num);
        let num = 7;
        println!("请输入的数字 {}", num);
    }

    pub fn str_ver() {
        let name = String::from("wang");
        println!("name is {}", name);
        println!("name is {}", name);
        let num = 4;
        println!("num is {}", num);
        println!("name is {}, num is {}", name, num);
    }

    pub fn str_mut() {
        let mut name = String::from("wang");
        println!("name is {}", name);
        //方法或者函数调用后堆上的对象已经消失，不可使用
        //使用clone
        let username = name.clone();
        print_str(name);
        let num = 4;
        println!("num is {}", num);
        //此处异常 name无效
        println!("name is {}, num is {}", username, num);
    }

    fn print_str(name : String) {
        println!("hello {}", name )
    }
}
